// Class include
#include "CObservable.hpp"

// System includes

// Other includes
#include "CTrace.hpp"
#include "CCommand.hpp"

CObservable::CObservable()
: mObserversVector()
{
}

CObservable::~CObservable()
{
}

void CObservable::addObserver(CObserver* o)
{
   if (0 != o)
   {
      mObserversVector.push_back(o);
   }
}

void CObservable::removeObserver(CObserver* o)
{
   // TODO: implement this method
}

void CObservable::notifyObservers(const CCommand& cmd)
{
   for(std::vector<CObserver*>::const_iterator it = mObserversVector.begin(); it != mObserversVector.end(); ++it)
   {
      (*it)->handleEvent(cmd);
   }
}
